package cn.gok.entity;

import cn.gok.factory.YamlConfigFactory;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.List;

/**
    @PropertySource : 用来读取自定义的配置文件
 */
@Component
@Data
@PropertySource(value = "classpath:myjdbc.yml",factory = YamlConfigFactory.class)
public class MyDataSource {

    @Value("${my.datasource.driver}")
    private String dirver;
    @Value("${my.datasource.username}")
    private String username;
    @Value("${my.datasource.password}")
    private String password;
    @Value("${my.datasource.size}")
    private Integer size;
}
